package com.tarrantcounty.entity;

public class Employee extends Person
{
	public static  float TAX_RATE = .0765f;
	private int empid;
	private float ytdSalary;
	private float ytdTax;
	
	public Employee() 
	{
		this("Jane Doe", 1000);
	}
	
	public Employee (String name, int eid) 
	{
		super (name);
		empid = eid;
	}
	
	public float getYtdSalary()
	{
		return ytdSalary;
	}

	public float getYtdTax()
	{
		return ytdTax;
	}
	public float getYtdNet()
	{
		return getYtdSalary() - getYtdTax();
	}

	/**
	 * Pay this employee amount.  Method withholds taxes from the amount.
	 * @param amount - gross amount to pay
	 * @return net amount of pay after taxes.
	 */
	public float pay(float amount)
	{
		float tax = amount * TAX_RATE;
		ytdTax += tax;
		ytdSalary += amount;
		return amount - tax;
		
	}

	@Override
	public String toString()
	{
		return super.toString() + " and my employee id is " + empid;
	}

	@Override
	public void speak()
	{
		System.out.println ("I don't work if it's icy!");
	}

	
	
}
